﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="PhuLeBooze.index" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
     <title>Rượu Phú Lễ - Bảo tồn hương vị truyền thống</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, width = device-width">
    <link href="Css/home/_cog_opt_css_67de420929174fac3b446b6f5b70f2f2.css" type="text/css" rel="stylesheet" media="all">
    <link href="Css/home/home.css" rel="stylesheet" />
    <link href="Css/home/cssPopup.css" rel="stylesheet" />
    <script async="" src="Css/home/all.js"></script>
    <script src="Css/home/_cog_opt_js_f359581ea4bd3379b4c25591838a5dd8.js" type="text/javascript"></script>
    <script src="Css/home/_cog_opt_js_524873508743955930e93729ace47396.js" type="text/javascript"></script>
    <script src="Css/home/_cog_opt_js_36f33f2599b9a442e8b779680fe1d384.js" type="text/javascript"></script>
     <link rel="shortcut icon" href="Images/favicon.ico" type="image/x-icon">
    <script>

        /**
 * Tells you the age from a string date
 * 
 * @param dateString Date in string format ex: "1981/3/27"
 * 
 * @return integer The calculated age
 **/
        function getAge(dateString) {
            var today = new Date();
            var birthDate = new Date(dateString);
            var age = today.getFullYear() - birthDate.getFullYear();
            var m = today.getMonth() - birthDate.getMonth();
            if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
                age--;
            }
            return age;
        }
        function checkAge() {
            var dd = $("#chiBirthDate_txt0").val();
            var MM = $("#chiBirthDate_txt1").val();
            var yyyy = $("#chiBirthDate_txt2").val();
            var age = getAge(yyyy + "/" + MM + "/" + dd);
            if (isNaN(age)) {
                $("#alertPopup")[0].click();
                return;
            }
            if (age < 18) {
                $("#alertPopup")[0].click();
                return;
            }
            window.location.href = "home.aspx";
        }
        $(function () {
            $("#chiBirthDate_txt0").keypress(function (e) {
                //if the letter is not digit then display error and don't type anything
                if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
                    //display error message
                    window.setTimeout(function () {
                        var val = $("#chiBirthDate_txt0").val();
                        if (val.length == 2 && !isNaN(val))
                            $("#chiBirthDate_txt1").focus();
                    }, 1000);
                    return false;
                }
            });
            $("#chiBirthDate_txt1").keypress(function (e) {
                //if the letter is not digit then display error and don't type anything
                if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
                    //display error message
                    window.setTimeout(function () {
                        var val = $("#chiBirthDate_txt1").val();
                        if (val.length == 2 && !isNaN(val))
                            $("#chiBirthDate_txt2").focus();
                    }, 100);
                    return false;
                }
            });
            $("#chiBirthDate_txt1").keypress(function (e) {
                //if the letter is not digit then display error and don't type anything
                if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
                    //display error message

                    return false;
                }
            });
        })
        function autotab(current, to) {
            if (current.getAttribute &&
              current.value.length == current.getAttribute("maxlength")) {
                to.focus()
            }
        }
    </script>
</head>

<body class="avp avp">
    <form id="form1" runat="server">
        <div id="wrapper">
            <canvas class="canvas-lines" width="1272" height="652"></canvas>

            <div id="content" class="main clearfix" style="min-height: 480px;">
                <div class="row">
                    <div class="grid-12 avp-content">
                        <div class="title market-int lang-en">
                            <h1><a href="home.aspx">Chivas</a></h1>
                            <span class="line"></span>
                            <strong>Chào Mừng Bạn Đến Website Rượu PHÚ LỄ
                                <br />

                                của<br />
                                CÔNG TY TNHH RƯỢU MẠNH PHÚ LỄ VIỆT NAM</strong>


                            <span class="line"></span>
                        </div>
                    </div>

                    <div class="grid-12 avp-fb">
                        <div class="block">
                            <div class="btn-fb-login">
                                <span class="icon icon-fb"></span>
                                <span class="title" style="height: 45px;" title="Connect with Facebook">Kết nối Facebook</span>
                            </div>
                        </div>
                    </div>

                    <div class="grid-12 avp-form">
                        <label>Năm sinh</label>
                        <div class="styled-input">
                            <input name="chiBirthDate$txt0" value="DD" maxlength="2" id="chiBirthDate_txt0" title="Day" type="tel" class="day hasSelection" watermark="DD" onkeyup="autotab(this, document.getElementById('chiBirthDate_txt1'))">
                            <input name="chiBirthDate$txt1" value="MM" maxlength="2" id="chiBirthDate_txt1" title="Month" type="tel" class="month hasSelection" watermark="MM" onkeyup="autotab(this, document.getElementById('chiBirthDate_txt2'))">
                            <input name="chiBirthDate$txt2" value="YYYY" maxlength="4" id="chiBirthDate_txt2" title="Year" type="tel" class="year offset0 hasSelection" watermark="YYYY" onkeyup="autotab(this, document.getElementById('lnkSubmit'))">
                        </div>
                        <a id="lnkSubmit" class="track" onclick="checkAge()">Enter</a>

                    </div>
                </div>
                <div class="grid-12"></div>
            </div>

            <div id="footer" class="main clearfix">
                <div class="row">
                    <div class="grid-12">
                        <p><a href="#TermsandConditions">Điều khoản  &amp; Điều  lệ sử dụng </a>|||| <a href="#PrivacyPolicyDetail">Chính sách quyền riêng tư</a> </p>
                        <span class="line"></span>
                        <div class="link-list">
                            <h3>Rượu PHÚ LỄ, chúng tôi cam kết uống có trách nhiệm.</h3>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </form>


    <a class="button" href="#openModal" style="display: none" id="alertPopup">Open it up!</a>

    <div id="openModal" class="modalbg">
        <div class="dialog" style="width: 500px;">
            <a href="#close" title="Close" class="close">X</a>
            <h2>Rất tiếc!!!</h2>
            <p>Bạn chưa đủ tuổi sử dụng rượu nên không thể đăng nhập website này. </p>
            <p>
                Cám ơn bạn đã quan tâm đến sản phẩm Rượu Phú Lễ của<br />
                CTY TNHH RƯỢU MẠNH PHÚ LỄ VIỆT NAM.
            </p>
        </div>
    </div>

    <div id="PrivacyPolicyDetail" class="modalbg">
        <div class="dialog" style="width: 600px;">
            <h2>Chính sách quyền riêng tư</h2>
            <a href="#close" title="Close" class="close">X</a>
            <div class="dlgPolicy">
            <asp:Literal ID="ltrPrivacyPolicyDetail" runat="server"></asp:Literal>
                </div>
        </div>

    </div>

    <div id="TermsandConditions" class="modalbg">
        <div class="dialog " style="width: 600px;">
            <h2>Điều khoản  &amp; Điều  lệ sử dụng</h2>
            <a href="#close" title="Close" class="close">X</a>
            <div class="dlgPolicy">
            <asp:Literal ID="ltrTermsandConditions" runat="server"></asp:Literal>
                </div>
        </div>

    </div>
    <script>
        $(function () {
            var winWidth = $(window).width() - 100 + "px";
            var winHeight = $(window).height() - 180 + "px";;
            $(".dlgPolicy").css({ "max-width": winWidth, "max-height": winHeight });
        });
    </script>
</body>
</html>
